load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "join",
    srcs = [
        "base_join_probe.go",
        "concurrent_map.go",
        "hash_join_base.go",
        "hash_join_spill.go",
        "hash_join_spill_helper.go",
        "hash_join_test_util.go",
        "hash_join_v1.go",
        "hash_join_v2.go",
        "hash_table_v1.go",
        "hash_table_v2.go",
        "index_lookup_hash_join.go",
        "index_lookup_join.go",
        "index_lookup_merge_join.go",
        "inner_join_probe.go",
        "join_row_table.go",
        "join_table_meta.go",
        "joiner.go",
        "left_outer_semi_join_probe.go",
        "merge_join.go",
        "outer_join_probe.go",
        "row_table_builder.go",
        "tagged_ptr.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/executor/join",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/executor/aggregate",
        "//pkg/executor/internal/applycache",
        "//pkg/executor/internal/exec",
        "//pkg/executor/internal/testutil",
        "//pkg/executor/internal/vecgroupchecker",
        "//pkg/executor/join/joinversion",
        "//pkg/executor/unionexec",
        "//pkg/expression",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/planner/core",
        "//pkg/planner/core/operator/logicalop",
        "//pkg/sessionctx",
        "//pkg/sessionctx/stmtctx",
        "//pkg/sessionctx/variable",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/bitmap",
        "//pkg/util/channel",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/dbterror/exeerrors",
        "//pkg/util/disk",
        "//pkg/util/execdetails",
        "//pkg/util/hack",
        "//pkg/util/intest",
        "//pkg/util/logutil",
        "//pkg/util/memory",
        "//pkg/util/mvmap",
        "//pkg/util/queue",
        "//pkg/util/ranger",
        "//pkg/util/serialization",
        "//pkg/util/sqlkiller",
        "//pkg/util/syncutil",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "join_test",
    timeout = "short",
    srcs = [
        "bench_test.go",
        "concurrent_map_test.go",
        "hash_table_v1_test.go",
        "hash_table_v2_test.go",
        "index_lookup_join_test.go",
        "index_lookup_merge_join_test.go",
        "inner_join_probe_test.go",
        "inner_join_spill_test.go",
        "join_row_table_test.go",
        "join_stats_test.go",
        "join_table_meta_test.go",
        "joiner_test.go",
        "left_outer_join_probe_test.go",
        "left_outer_semi_join_probe_test.go",
        "merge_join_test.go",
        "outer_join_spill_test.go",
        "right_outer_join_probe_test.go",
        "row_table_builder_test.go",
        "tagged_ptr_test.go",
    ],
    embed = [":join"],
    flaky = True,
    shard_count = 50,
    deps = [
        "//pkg/config",
        "//pkg/domain",
        "//pkg/executor/internal/testutil",
        "//pkg/expression",
        "//pkg/parser/ast",
        "//pkg/parser/mysql",
        "//pkg/planner/core/operator/logicalop",
        "//pkg/session",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/testkit",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/disk",
        "//pkg/util/hack",
        "//pkg/util/memory",
        "//pkg/util/mock",
        "//pkg/util/sqlkiller",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_stretchr_testify//require",
    ],
)
